package http

import (
	"io"

	"gitee.com/ameise84/e3utils/bytes_buffer"
	"github.com/gin-gonic/gin"
)

type ResponseWriter struct {
	gin.ResponseWriter
	OldRead io.ReadCloser
	RspBuf  *bytes_buffer.ShiftBuffer
}

func (ts *ResponseWriter) Write(data []byte) (int, error) {
	if ts.RspBuf != nil {
		_, _ = ts.RspBuf.Write(data)
	}
	return ts.ResponseWriter.Write(data)
}
